package cn.com.cifi.mars.web.action.goodsValueApprove;

import java.util.List;
import java.util.Map;

import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import cn.com.cifi.mars.bean.vo.price.ApprovedRecordViewVO;
import cn.com.cifi.mars.bean.vo.price.ApprovedViewVO;
import cn.com.cifi.mars.bean.vo.price.BasicInfoVO;
import cn.com.cifi.mars.bean.vo.price.DifferenceReviewVersionVO;
import cn.com.cifi.mars.bean.vo.price.OperateVO;
import cn.com.cifi.mars.bean.vo.price.req.PriceApproveReqParam;
import cn.com.cifi.mars.bean.vo.price.req.PriceApproveWarnCancelReqParam;
import cn.com.cifi.mars.bean.vo.price.req.PriceApproveWarnSaveReqParam;
import cn.com.cifi.mars.common.bean.R;
import cn.com.cifi.mars.common.constants.VersionConstant;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

import javax.servlet.http.HttpServletResponse;

@Api(tags = "货值审批 API")
@RequestMapping("/${spring.data.rest.base-path}/{apiVersion}/valueApprovel")
public interface IAllGoodsValueController {

	@ApiOperation(value = "审批校验", notes = "货值审批-审批校验")
	@GetMapping(value = "approvedCheck")
	R<Map<String, Boolean>> approvedCheck(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@RequestParam(name = "projectId",required = true) String projectId,
			@RequestParam(name = "approvedType", required = true) String approvedType);

	@ApiOperation(value = "基本信息", notes = "货值审批-基本信息")
	@GetMapping(value = "basicInfo")
	R<BasicInfoVO> basicInfo(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@RequestParam(name = "projectId", required = false) String projectId,
			@RequestParam(name = "businessKey", required = false) String businessKey);

	
	@ApiOperation(value = "App基本信息", notes = "货值审批-基本信息(App)")
	@GetMapping(value = "/app/basicInfo")
	R<BasicInfoVO> appBasicInfo(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@RequestParam(name = "projectId", required = false) String projectId,
			@RequestParam(name = "businessKey", required = false) String businessKey);
	
	
	@ApiOperation(value = "本次填报版本", notes = "货值审批-本次填报版本")
	@GetMapping(value = "approvedInfo")
	R<Map<String, String>> approvedInfo(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@RequestParam(name = "projectId", required = false) String projectId,
			@RequestParam(name = "businessKey", required = false) String businessKey);

	@ApiOperation(value = "APP本次填报版本", notes = "货值审批-本次填报版本(App)")
	@GetMapping(value = "/app/approvedInfo")
	R<Map<String, String>> appApprovedInfo(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@RequestParam(name = "projectId", required = false) String projectId,
			@RequestParam(name = "businessKey", required = false) String businessKey);
	
	@ApiOperation(value = "定调价预警信息", notes = "货值审批-定调价预警信息")
	@GetMapping(value = "/warnInfo")
	R warnInfo(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@RequestParam(name = "projectId", required = false) String projectId,
			@RequestParam(name = "businessKey", required = false) String businessKey);
	

	@ApiOperation(value = "全盘货值差异概览", notes = "货值审批-全盘货值差异概览")
	@GetMapping(value = "newAllgoodsValueReview")
	R<List<DifferenceReviewVersionVO>> newAllgoodsValueReview(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@RequestParam(name = "projectId", required = false) String projectId,
			@RequestParam(name = "businessKey", required = false) String businessKey);

	@ApiOperation(value = "导出全盘货值差异概览", notes = "导出货值审批-全盘货值差异概览")
	@GetMapping(value = "newAllgoodsValueReviewExport")
	void newAllgoodsValueReviewExport(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@RequestParam(name = "projectId", required = false) String projectId,
			@RequestParam(name = "businessKey", required = false) String businessKey,
			HttpServletResponse response);

	@ApiOperation(value = "导出货值审批核心指标表", notes = "导出货值审批核心指标表")
	@GetMapping(value = "/priceApprovalCoreWarnExport")
	void priceApprovalCoreWarnExport(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@RequestParam(name = "businessKey", required = false) String businessKey,
			HttpServletResponse response);

	@ApiOperation(value = "导出本次调价楼栋", notes = "导出货值审批楼栋均价差异表")
	@GetMapping(value = "priceApprovalDifferencesBuildExport")
	void priceApprovalDifferencesBuildExport(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@RequestParam(name = "businessKey", required = false) String businessKey,
			HttpServletResponse response);

	@ApiOperation(value = "App全盘货值差异概览", notes = "货值审批-全盘货值差异概览(App)")
	@GetMapping(value = "/app/newAllgoodsValueReview")
	R<List<DifferenceReviewVersionVO>> appNewAllgoodsValueReview(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@RequestParam(name = "projectId", required = false) String projectId,
			@RequestParam(name = "businessKey", required = false) String businessKey);

	@ApiOperation(value = "差异详情", notes = "货值审批-差异详情")
	@GetMapping(value = "newAllgoodsValueDetail")
	R newAllgoodsValueDetail(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@RequestParam(name = "projectId", required = false) String projectId,
			@RequestParam(name = "businessKey", required = false) String businessKey,
			@ApiParam(value = "对比版本", required = true) @RequestParam(name = "type", required = true) String type);

	@ApiOperation(value = "导出差异详情", notes = "导出货值审批-差异详情")
	@GetMapping(value = "newAllgoodsValueDetailExport")
	void newAllgoodsValueDetailExport(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@RequestParam(name = "projectId", required = false) String projectId,
			@RequestParam(name = "businessKey", required = false) String businessKey,
			HttpServletResponse response);

	@ApiOperation(value = "APP差异详情", notes = "APP货值审批-差异详情")
	@GetMapping(value = "/app/newAllgoodsValueDetail")
	R appAllgoodsValueDetail(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@RequestParam(name = "projectId", required = false) String projectId,
			@RequestParam(name = "businessKey", required = false) String businessKey,
			@ApiParam(value = "对比版本", required = true) @RequestParam(name = "type", required = true) String type);


	@ApiOperation(value = "提交到OA审批", notes = "货值审批-提交到OA审批")
	@PostMapping(value = "submitToOA")
	R<Map<String, String>> submitToOA(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "审批预警信息", required = true) @RequestBody PriceApproveReqParam priceApproveReqParam);

	@ApiOperation(value = "货值审批记录", notes = "查看货值审批记录")
	@GetMapping(value = "goodsApprovedRecoreViewPage")
	R<ApprovedRecordViewVO> goodsApprovedRecordView(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "项目id", required = true) @RequestParam(name = "projectId") String projectId,
			@ApiParam(value = "搜索关键字", required = false) @RequestParam(name = "searchStr", required = false) String searchStr,
			@ApiParam(value = "当前第几页", required = true, defaultValue = "1") @RequestParam(value = "current") String current,
			@ApiParam(value = "每页条数", required = true, defaultValue = "20") @RequestParam(value = "pageSize") String pageSize,
			@ApiParam(value = "货值(price_management),签约(signing_plan)", required = true) @RequestParam(value = "businessType") String businessType);

	@ApiOperation(value = "查看审批", notes = "查看货值审批")
	@GetMapping(value = "goodsApprovedView")
	R<ApprovedViewVO> goodsApprovedView(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "版本id", required = true) @RequestParam(name = "versionId") String versionId);
	
	@ApiOperation(value = "货值审批-废弃流程", notes = "废弃流程实例")
	@PutMapping(value = "approvedOperation")
	R endFlow(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "实例id", required = true) @RequestParam(name = "instanceId") String instanceId);

	@ApiOperation(value = "货值审批-删除流程", notes = "删除流程实例")
	@DeleteMapping(value = "approvedOperation")
	R<OperateVO> deleteFlow(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "实例id", required = true) @RequestParam(name = "instanceId") String instanceId);
	
	@ApiOperation(value = "预警督办-保存督办", notes = "预警督办-保存督办")
	@PutMapping(value = "saveSupervise")
	R saveSupervise(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "预警督办信息", required = true) @RequestBody PriceApproveWarnSaveReqParam param);
	
	@ApiOperation(value = "预警督办-取消督办", notes = "预警督办-取消督办")
	@PutMapping(value = "cancelSupervise")
	R cancelSupervise(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "取消督办信息", required = true) @RequestBody PriceApproveWarnCancelReqParam param);
	
	
	//############################################################################################################################################
	@ApiOperation(value = "手动生成集团审批版数据", notes = "手动生成集团审批版数据（基于供销存系统）")
	@GetMapping(value = "generatePriceVersionGroup")
	R generatePriceVersionGroup(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "项目id", required = true) @RequestParam(name = "projectId") String projectId,
			@ApiParam(value = "审批单ID", required = true) @RequestParam(name = "flowId") String flowId,
			@ApiParam(value = "是否集团审批版", required = true) @RequestParam(name = "isPresident") Integer isPresident);
	
	
	@ApiOperation(value = "手动创建集团审批版数据", notes = "手动创建集团审批版数据（基于销管系统）")
	@GetMapping(value = "createPriceVersionGroup")
	R createPriceVersionGroup(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "项目id", required = true) @RequestParam(name = "projectId") String projectId,
			@ApiParam(value = "方案ID", required = true) @RequestParam(name = "schemeId") String schemeId);
}
